package com.sefon.smarteconomy.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sefon.smarteconomy.domain.User;
import com.sefon.smarteconomy.service.IUserService;

/**
 * 
* Copyright: Copyright (c) 2018 SefonSoft
* 
* @ClassName: PublicController.java
* @Description: 对外接口controller
*
* @version: v1.0.0
* @author: SF2170
* @date: 2018年3月21日上午11:02:06
*
 */
@RestController
@RequestMapping("/public")
public class PublicController {

	@Autowired
	private IUserService userService;
	
	@RequestMapping(value = "/test")
	public String login() {
		return "hello world!";
	}
	
	@RequestMapping(value = "/show")
	public String show(HttpServletRequest request, String id) {
		User user = userService.findById(id==null ?"8d19967fd4b14ef89244d84ef0d607eb":id);
		return user.getUserName();
	}
}
